using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using OVS.BusinessObjects;
using OVS.DAL;

namespace OVS.BLL
{
	public partial class CameraBLL
	{
		private CameraDAO _CameraDAO;

		public CameraDAO CameraDAO
		{
			get { return _CameraDAO; }
			set { _CameraDAO = value; }
		}

		public CameraBLL()
		{
			CameraDAO = new CameraDAO();
		}
		public List<Camera> GetCameras()
		{
			try
			{
				return CameraDAO.GetCameras();
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public Camera GetCamera(int came_id)
		{
			try
			{
				return CameraDAO.GetCamera(came_id);
			}
			catch(Exception ex)
			{
				throw ex;
			}
		}
		public int AddCamera(Camera oCamera)
		{
			try
			{
				return CameraDAO.AddCamera(oCamera);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int UpdateCamera(Camera oCamera)
		{
			try
			{
				return CameraDAO.UpdateCamera(oCamera);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveCamera(Camera oCamera)
		{
			try
			{
				return CameraDAO.RemoveCamera(oCamera);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public int RemoveCamera(int came_id)
		{
			try
			{
				return CameraDAO.RemoveCamera(came_id);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public List<Camera> DeserializeCameras(string Path)
		{
			try
			{
				return GenericXmlSerializer<List<Camera>>.Deserialize(Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
		public void SerializeCameras(string Path, List<Camera> Cameras)
		{
			try
			{
				GenericXmlSerializer<List<Camera>>.Serialize(Cameras, Path);
			}
			catch (Exception ex)
			{
				throw ex;
			}
		}
	}
}
